import LoaderContainer from '@/pages/workbench/loader';
import { useEffect } from 'react';

interface DetailPageProps {
    pageType: string,
    code: string,
    pageCode: string,
    type: string,
}

export const DetailPage = (props: DetailPageProps) => {
    const { pageType, code, type } = props;
    console.log('DetailPage', pageType, code);
    if (!pageType) {
        return <div></div>;
    }
    const pageDetail = pageType.replace(pageType[0], pageType[0].toLowerCase());
    if (!LoaderContainer?.[`${pageDetail}DetailInvoice`]) {
        return <div></div>;
    }
    const Comp = LoaderContainer?.[`${pageDetail}DetailInvoice`];
    return <Comp
        businessNo={code}
        code={code}
        type={type}
        needFooter={false}
        isComponent
    />
};

export default DetailPage;